<!DOCTYPE html>
<html data-layout-decorate="~{bbs/layout/layout}">
<head>
    <title>所有课程</title>
</head>
<body>
<section data-layout-fragment="content">

    <div class="container">
        <div class="row">
            <div class="col-md-9">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div style="overflow: hidden;">

                            <div class="col-md-3 tag-item" data-th-each="course:${courseList}" align="center">
                                <a class="tag" data-th-href="${#httpServletRequest.contextPath+'/bbs/?courseId='+course.id}" data-th-text="${course.name}">spring-boot</a>
                                <!--<span class="text-muted">x 21</span>-->
                            </div>

                        </div>

                        <!--<div class="divide"></div>-->
                        <nav>
                            <input style="display: none" id="upPageNumber" data-th-value="${upPageNumber}">
                            <input style="display: none" id="downPageNumber" data-th-value="${downPageNumber}">
                            <input style="display: none" id="totalPages" data-th-value="${totalPages}">
                            <ul class="pager">
                                <li id="upPage"><a data-th-href="'?pageNo='+${upPageNumber}">上一页</a></li>

                                <!--页码-->
                                &nbsp;[[${nowPageNumber}]] / [[${totalPages}]]

                                <li id="downPage"><a data-th-href="'?pageNo='+${downPageNumber}">下一页</a></li>

                            </ul>
                        </nav>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            var upPageNumber = $('#upPageNumber').val();
            var downPageNumber = $('#downPageNumber').val();
            var totalPages = $('#totalPages').val();

            if (upPageNumber <= 0) {
                $('#upPage').addClass('disabled');
                $('#upPage a').attr('href', '//');
            }
            if (downPageNumber > totalPages) {
                $('#downPage').addClass('disabled');
                $('#downPage a').attr('href', '//');
            }
        });
    </script>
</section>
</body>
</html>